package app.controller;

import app.service.NacosProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yaml.snakeyaml.events.Event;
import pojo.User;

@RestController
public class NacosController {
    @Autowired
    private NacosProviderService  nacosProviderService;

    @GetMapping("/findId/{id}")
    public User getUser(@PathVariable Integer id){
     return nacosProviderService.getUser(id);
    }


    @GetMapping("/consumer/findId")
    public User getUser(Integer id,String nam){
        return nacosProviderService.getUser(id,nam);
    }
}
